#include <bits/stdc++.h>
using namespace std; 
set<int> S;
int main() {
  int N;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int num;
    cin >> num;
    S.insert(num);
  }
  
  cout << S.size() << endl;
 
  for (auto k : S) {
    cout << k << " ";
  }
  cout << endl;
  return 0;
}